package cn.com.bluemoon.daps.model.controller.api;

import cn.com.bluemoon.daps.api.model.RemoteDapDataModelSystemTagMiddleService;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiModel;
import cn.com.bluemoon.daps.common.datascope.BmPermission;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.model.entity.DapDataModelSystemTagMiddle;
import cn.com.bluemoon.daps.model.service.DapDataModelSystemTagMiddleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = {"FeignClient服务-模型关联标签api接口"})
@RequestMapping(DapsApiModel.API_MODEL_TAG)
@BmPermission(value = "", name = "服务注册-模型关联标签", ignore = true)
@RestController
@Slf4j
public class DapDataModelSystemTagMiddleServiceApi implements RemoteDapDataModelSystemTagMiddleService {

    @Resource
    DapDataModelSystemTagMiddleService dapDataModelSystemTagMiddleService;

    @GetMapping("/tagMiddle/{id}")
    public ResultBean<List<DapDataModelSystemTagMiddle>> getTagMiddleList(@PathVariable("id")
                                                                   @ApiParam("标签id") String id){
        return ResultBean.ok(dapDataModelSystemTagMiddleService.getListByTagId(id));
    }
}
